<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"    uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
    
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">查询派车单&nbsp;-&nbsp;派车单详情</li>
    </ol>
    
    <div class="ms-content-layout">
    
      <div class="block-heading">
         <h5>派车单信息</h5>
      </div>
      
      <div class="form-horizontal ms-form form-personal-info">
      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">派车单号：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static">${dispatchOrderRecord.dispatchOrderCode}</p>
	        </div>
	        <label class="col-xs-2 control-label">调度指令组号：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static">${dispatchOrderRecord.shipmentGroupId}</p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">起始地：</label>
	        <div class="col-xs-3 ">
	          <p class ="form-control-static">${dispatchOrderRecord.startFacilityName}</p>
	        </div>
	        <label class="col-xs-2 control-label">目的地：</label>
	         <div class="col-xs-3 ">
	           <p class ="form-control-static">${dispatchOrderRecord.endFacilityName}</p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">派车单日期：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static">
	            <fmt:formatDate value="${dispatchOrderRecord.dispatchDate}" pattern="yyyy-MM-dd" />
	          </p>
	        </div>
	        <label class="col-xs-2 control-label">驳运车号：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static">${dispatchOrderRecord.vehicleName}</p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">默认行驶公里数：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static">
	            <fmt:formatNumber value="${dispatchOrderRecord.facilityDistanceDefault}" minFractionDigits="2" />
	          </p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">主驾驶员：</label>
          <div class="col-xs-3">
            <p class ="form-control-static">${dispatchOrderRecord.mainDriver}</p>
          </div>
	        <label class="col-xs-2 control-label">第一副驾驶员：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static">
	            <c:if test="${dispatchOrderRecord.firstViceDriver ne ' - '}">
	               ${dispatchOrderRecord.firstViceDriver}
	            </c:if>
	          </p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">行驶公里数调整：</label>
          <div class="col-xs-3">
            <p class ="form-control-static">
              <fmt:formatNumber value="${dispatchOrderRecord.facilityDistance - dispatchOrderRecord.facilityDistanceDefault}" minFractionDigits="2" />
            </p>
          </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">备注：</label>
	        <div class="col-xs-8">
	          <textarea  rows="5" style="width: 80%;" readonly="readonly">${dispatchOrderRecord.distanceAdjustRemark}</textarea>
	        </div>
	      </div>
      
      </div>
      
      <div class="form-horizontal ms-form form-personal-info" style="margin-top: 50px;">
      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">路桥费：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.roadFee}" minFractionDigits="2"/></p>
	        </div>
	        <label class="col-xs-2 control-label">修理费：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.repairFee}" minFractionDigits="2"/> </p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">轮胎费：</label>
	        <div class="col-xs-8">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.tyreFee}" minFractionDigits="2"/></p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">主驾重载工资单价：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.mainDriverFullSalary}" minFractionDigits="2"/></p>
	        </div>
	        <label class="col-xs-2 control-label">主驾空载工资单价：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"> <fmt:formatNumber value="${transportCost.mainDriverEmptySalary}" minFractionDigits="2"/></p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">主驾工资：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.mainDriverSalary}" minFractionDigits="2"/></p>
	        </div>
	        <label class="col-xs-2 control-label">第一副驾重载工资单价：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.firstViceDriverFullSalary}" minFractionDigits="2"/></p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">第一副驾空载工资单价：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.firstViceDriverEmptySalary}" minFractionDigits="2"/></p>
	        </div>
	        <label class="col-xs-2 control-label">第一副驾工资：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.firstViceDriverSalary}" minFractionDigits="2"/></p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">重载油耗：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.fullOilUsagePerKm}" minFractionDigits="2"/></p>
	        </div>
	        <label class="col-xs-2 control-label">空载油耗：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.emptyOilUsagePerKm}" minFractionDigits="2"/></p>
	        </div>
	      </div>
	      
	       <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">装载能力：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static">${dispatchOrder.fullLoadNumber}</p>
	        </div>
	        <label class="col-xs-2 control-label">加油类型：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"> ${transportCost.oilTypeId == 3 ? '0#' : '-10#'}</p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">加油量：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.oilUsage}" minFractionDigits="2"/></p>
	        </div>
	        <label class="col-xs-2 control-label">内部加油量：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.internalOilUsage}" minFractionDigits="2"/> </p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">内部油价：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.internalOilPrice}" minFractionDigits="2"/></p>
	        </div>
	        <label class="col-xs-2 control-label">外部油价：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.externalOilPrice}" minFractionDigits="2"/></p>
	        </div>
	      </div>
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">油费：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"><fmt:formatNumber value="${transportCost.totalOilFeeReimbursed}" minFractionDigits="2"/></p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">是否打印报销单：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static">${dispatchOrderRecord.expenseReimbursed ? "是" : "否"}</p>
	        </div>
	        <label class="col-xs-2 control-label">是否已报销：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"> ${dispatchOrderRecord.expenseReimbursed ? "是" : "否"}</p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">是否回单确认：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static">${dispatchOrderRecord.accomplishConfirm ? "是" : "否"}</p>
	        </div>
	        <label class="col-xs-2 control-label">回单数量：</label>
	        <div class="col-xs-3">
	          <p class ="form-control-static"> ${dispatchOrderRecord.accomplishConfirmNumber}</p>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
	        <label class="col-xs-2 control-label">备注：</label>
	        <div class="col-xs-8">
	          <textarea rows="5" style="width: 80%;" readonly="readonly">${dispatchOrder.remarks}</textarea>
	        </div>
	      </div>
      
      </div>
      
      <div class="block-heading">
       <h5>其他费用列表</h5>
      </div>
      
      <table class="table table-hover ms-table shipment-car-table">
        <thead>
          <tr>
            <th>其它费用名称</th>
            <th>金额</th>
            <th>安吉物流设置金额</th>
          </tr>
        </thead>
        
        <tbody>
          
          <c:forEach items="${otherFeeMap.keySet()}" var="otherFeeTypeId">
            <tr>
              <td>${otherFeeMap[otherFeeTypeId].feeName}</td>
              <td>
                <input type="text" name="otherFees" value="${otherFeeMap[otherFeeTypeId].otherFee == null ? '0.00' : otherFeeMap[otherFeeTypeId].otherFee}" data-validate="float|min,0|max_decimal_digit,2"/>
                <input type="hidden" name="otherFeeTypeIds" value="${otherFeeTypeId}"/>
              </td>
              <td>${otherFeeMap[otherFeeTypeId].anjiFee}<%-- <input type="hidden" name="anjiFee" value="${otherFeeMap[otherFeeTypeId].anjiFee}"/> --%></td>
            </tr>
          </c:forEach>
          
          <tr>
            <td colspan="3">
              <div>其他费用审核人：<input type="text" name="otherFeeAuditor" value="${transportCost.otherFeeAuditor}" /></div>
            </td>
          </tr>
          
        </tbody>
        
      </table>

      <div class="block-heading">
       <h5>商品车明细列表</h5>
       <h5 style="margin-left: 70%;">调度数量：${dispatchOrder.actualLoadNumber}</h5>
      </div>
    
      <c:forEach items="${shipmentOrders}" var="order">
      
        <div class="form-horizontal ms-form form-personal-info">
      
          <div class="form-group ms-form-group">
            <div class="col-xs-2">
              <p class ="form-control-static">订单号：${order.code}</p>
            </div>
            <div class="col-xs-2">
              <p class ="form-control-static">客户：${order.client}</p>
            </div>
            <div class="col-xs-2 ">
              <p class ="form-control-static">订单起始地：${order.startFacility}</p>
            </div>
            <div class="col-xs-2 ">
              <p class ="form-control-static">订单目的地：${order.endFacility}</p>
            </div>
            <div class="col-xs-2">
              <p class ="form-control-static">结算公里数：${order.kilometer}</p>
            </div>
            <div class="col-xs-2">
              <p class ="form-control-static">单价：${order.contractRate}</p>
            </div>
          </div>
         
        </div>
      
        <table class="table table-hover ms-table">
          <thead class="blue-header">
            <tr>
              <th>VIN码头</th>
              <th>数量</th>
              <th>车型</th>
              <th>颜色</th>
              <th>运输方式</th>
              <th>装车道号</th>
              <th>制造商</th>
              <th>起始地</th>
              <th>目的地</th>
              <th>目的地地址</th>
              <th>目的地联系电话</th>
              <th>预计装运时间</th>
              <th>预计起运时间</th>
            </tr>
          </thead>
          <tbody>
            <c:forEach items="${order.shipmentOrderItems}" var="item">
              <tr>
                <td>${item.vinCode}</td>
                <td>${item.quantity}</td>
                <td>${item.carType}</td>
                <td>${item.carColor}</td>
                <td>${item.transType}</td>
                <td>${item.driveWay}</td>
                <td>${item.manufactor}</td>
                <td>${item.startFacility}</td>
                <td>${item.endFacility}</td>
                <td>${item.destinationAddress}</td>
                <td>${item.destinationTelecomNumber}</td>
                <td>${item.loadDate}</td>
                <td>${item.deptDate}</td>
              </tr>
            </c:forEach>
          </tbody>
        </table>

      </c:forEach>

    </div> 
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp"%>

</body>
</html>